cc.Class({
    extends: cc.Component,

    properties: {
        anim:{
            default:null,
            type:cc.Animation
        }
    },

    init() {
        this.getComponent('walk').init(this);
        return this;
    },
    
    play:function(direction) {
        switch(direction) {
            case 1:
                this.anim.play('walk_left');
                break;
            case 2:
                this.anim.play('walk_right');
                break;
        }
      
    },
    
    stop:function() {
        this.anim.stop();
    },
    // use this for initialization
    onLoad: function () {

    },

    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },
});
